exports.getConfig = (imgData, data) => ({
  title: {
    text: 'Awesome ECharts',
  },
  tooltip: {},
  backgroundColor: '#fff',
  xAxis3D: {
    type: 'value',
  },
  yAxis3D: {
    type: 'value',
  },
  zAxis3D: {
    type: 'value',
    min: 0,
    max: 100,
  },
  grid3D: {
    viewControl: {
      alpha: 70,
      beta: 0,
    },
    postEffect: {
      enable: true,
      SSAO: {
        enable: true,
      },
    },
    boxDepth: 120,
    light: {
      main: {
        shadow: true,
        intensity: 2,
      },
      ambientCubemap: {
        texture: '@/assets/hdr/Arches_E_PineTree_3k.hdr',
        exposure: 2,
        diffuseIntensity: 0.2,
        specularIntensity: 1,
      },
    },
  },
  series: [
    {
      type: 'bar3D',
      shading: 'realistic',
      barSize: 1,
      wireframe: {
        show: false,
      },
      itemStyle: {
        color: params => {
          const i = params.dataIndex;
          const r = imgData.data[i * 4];
          const g = imgData.data[i * 4 + 1];
          const b = imgData.data[i * 4 + 2];

          return `rgb('${[r, g, b].join(', ')}')`;
        },
      },
      data,
    },
  ],
});
